package com.cafe.model;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.malamute.core.entity.BaseEntity;
import com.malamute.system.entity.FileInSystem;

/**
 * 广告海报
 * 
 */
@Entity
@Table(name = "T_CAFE_PLACARD")
public class Placard extends BaseEntity {
	private String title;// 标题
	private String url;// 链接
	// @OneToOne(targetEntity = FileInSystem.class, fetch = FetchType.EAGER,
	// cascade = CascadeType.PERSIST)
	// private FileInSystem fileInSystem;// 对应图片
	@OneToOne(mappedBy = "placard", fetch = FetchType.EAGER, cascade = CascadeType.ALL)
	private PlacardFile placardFile;
	@Enumerated(value = EnumType.ORDINAL)
	private PlacardType type = PlacardType.NORMAL;

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	// public FileInSystem getFileInSystem() {
	// return fileInSystem;
	// }
	//
	// public void setFileInSystem(FileInSystem fileInSystem) {
	// this.fileInSystem = fileInSystem;
	// }

	public PlacardType getType() {
		return type;
	}

	public void setType(PlacardType type) {
		this.type = type;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public PlacardFile getPlacardFile() {
		return placardFile;
	}

	public void setPlacardFile(PlacardFile placardFile) {
		this.placardFile = placardFile;
	}

}
